package com.lucun.es_transaction.entity;

/**
 * @Author: 郭鑫
 * @catalogue: com.lucun.es_transaction.entity
 * @Date: 2021/6/7 16:48
 * @Version: 1.0
 */
import java.io.Serializable;
public class ResponseResult implements Serializable {
    private static final long serialVersionUID = -4971076199594828397L;
    /**状态:1 ok,0 error*/
    private Integer state=1;
    /**状态信息*/
    private String message="ok";
    /**业务层返回的正确响应数据*/
    private Object data;
    public ResponseResult(){}
    public ResponseResult(String message){ //new JsonResult("update ok");
        this.message=message;
    }
    public ResponseResult(Object data){
        this.data=data;
    }
    public ResponseResult(Throwable e){
        this.state=0;
        this.message=e.getMessage();
    }
    public Integer getState() {
        return state;
    }
    public void setState(Integer state) {
        this.state = state;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public Object getData() {
        return data;
    }
    public void setData(Object data) {
        this.data = data;
    }
}